
my_list = [1,5,8,-17,15,25,78,-5,36,50,40]

sum1 = 0
for i in my_list[0:5]:
    sum1 += i


sum2 = 0
for i in my_list[-5:]:
    sum2 += i

my_list.append(sum1)
my_list.append(sum2)

print(my_list)